package xiaoqi.feign.provider.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RestController;
import xiaoqi.provider.api.ProviderService;



@RestController
public class ProviderController implements ProviderService {

    private Logger logger = LoggerFactory.getLogger(ProviderController.class);

    @Value("${server.port}")
    private Integer serverPort;

    @Override
    public String echo(String name) {
        try {
            Thread.sleep(100L);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        logger.info("[echo][被调用了 name:{}]", name);
        return serverPort + "-serverPort";
    }
}
